wayland: Stop using surface->parent
authorMatthias Clasen <mclasen@redhat.com>
Sat, 23 Mar 2019 13:11:46 +0000 (09:11 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 28 May 2019 20:25:13 +0000 (20:25 +0000)
It is always NULL.

gdk/wayland/gdksurface-wayland.c

index b4af4e09c708e6c597dde69d0145599cf0d2789a..a1088a74df5415c5427e28a4accba1924287d8b4 100644 (file)
@@ -2850,6 +2850,8 @@ gdk_wayland_surface_destroy (GdkSurface *surface,
                              gboolean    recursing,
                              gboolean    foreign_destroy)
 {
+  GdkWaylandDisplay *display;
+
   g_return_if_fail (GDK_IS_SURFACE (surface));
 
   /* Wayland surfaces can't be externally destroyed; we may possibly
@@ -2859,11 +2861,8 @@ gdk_wayland_surface_destroy (GdkSurface *surface,
 
   gdk_wayland_surface_hide_surface (surface);
 
-  if (surface->parent == NULL)
-    {
-      GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
-      display->toplevels = g_list_remove (display->toplevels, surface);
-    }
+  display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
+  display->toplevels = g_list_remove (display->toplevels, surface);
 }
 
 static void